package com.wxiao.exam.Impl;

import com.wxiao.exam.ManagerService;
import com.wxiao.exam.Result;
import com.wxiao.exam.mapper.ManagerMapper;
import com.wxiao.exam.pojo.ManagerDO;
import com.wxiao.exam.pojo.vo.ManagerVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <br/>
 * Created by wangxiao on 2019/07/05
 */
@Service("managerService")
public class ManagerServiceImpl implements ManagerService {

    private final static Logger LOG = LoggerFactory.getLogger(ManagerServiceImpl.class);

    @Resource
    private ManagerMapper managerMapper;

    @Override
    public Result addManager(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public Result updateManager(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public Result findDetailManager(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public Result listManager(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public Result listManagerPage(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public Result countManager(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public Result deleteManager(ManagerVO managerVO) throws Exception {
        return null;
    }

    @Override
    public ManagerDO getManagerByName(String username) {
        ManagerVO managerVO = new ManagerVO();
        managerVO.setName(username);
        List<ManagerDO> managerDOS = managerMapper.listManager(managerVO);
        if (!managerDOS.isEmpty()) {
            return managerDOS.get(0);
        } else
            return null;
    }

}